let express = require('./express');
let app = express();
let fs = require('fs')
let path = require('path')

app.use(express.static(__dirname));


// app.use('/api',function (req, res, next) {
//   next();
// });
app.get('/f',function (req, res) {
  res.sendFile(path.resolve(__dirname,'index.html'))
});

app.get('/',function (req, res) {
  res.send('hello')
})
app.get('/user/:id/:name',function (req, res) {
  res.end(JSON.stringify(req.params))
})


// app.use(function (req, res, next) {
//   next('error');
// });
// app.use(function (err,req, res, next) {
//   console.log( err);
//   next(err);
// });

app.listen(3000,()=>{
  console.log(`start 3000.`)
});
